<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <input type="text" name="" id="" value="默认值...">
    <button>按钮</button>
</body>
<Script>
    let input = document.querySelector('input');
    let button = document.querySelector('button');

    button.onclick = function () {
        // console.log(input.innerText);
        // console.log(input.innerHTML);
        console.log(input.value);
    }
</Script>
</html>